package com.yun.zf.common.admin.domain;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 业务员表
 */
@TableName("sys_agent")
@Data
public class SysAgent {
    private int id;
    @ApiModelProperty(value = "账号id")
    private long userId;
    @ApiModelProperty(value = "部门id")
    private  Long deptId;
    @ApiModelProperty(value = "证件号码")
    private String cardNo;
    @ApiModelProperty(value = "姓名")
    private String name;
    @ApiModelProperty(value = "手机号码")
    private String iphone;
    @ApiModelProperty(value = "状态")
    private int status;
    @ApiModelProperty(value = "邮箱")
    private String email;
    @ApiModelProperty(value = "工号")
    private int agentNo;
    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime=new Date();
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date modifiedTime=new Date();
    @ApiModelProperty(value = "市级区划代码")
    private  Long cityCode;
    @ApiModelProperty(value = "省级区划代码")
    private Long provinceCode;
    @ApiModelProperty(value = "部门名称")
    private  String deptName;
    @ApiModelProperty(value = "省级名称")
    private String provinceName;
    @ApiModelProperty(value = "城市名称")
    private String cityName;
    @ApiModelProperty(value = "岗位id")
    private Long postId;
    @ApiModelProperty(value = "备注")
    private String remarks;
    @ApiModelProperty(value = "是否在职，0在职，2离职")
    private  int delFlag;
    @ApiModelProperty(value = "部门级联json 数组")
    private String  deptIds;
    @ApiModelProperty(value = "头像")
    private String avatar;
    @ApiModelProperty(value = "微信号码")
    private String weixin;

    @TableField(exist = false)
    private String [] dept;

    @TableField(exist = false)
    private String[] city;

    // 前台下拉使用
    public String[] getDept() {
        return JSON.parseObject(deptIds,String[].class);
    }
}
